import { ApiProperty, PartialType, PickType } from '@nestjs/swagger';
import { CntrSizeDto, CntrTypeDto, CyCfsDto, CyCfsAreaDto, ClientDto, PlaceDto, SCodeDto, CfsStorageDto, UserQueryCfgDto } from './create-basedatum.dto';
import { IsNotEmpty, IsNumber, IsString } from 'class-validator';
import { UpdateDto } from '@/common/type/app.dto';
import { FeeReportDefineDto } from '@/business/dto/create-business.dto';


export class UpdateSCodeDto extends PartialType(SCodeDto) implements UpdateDto {
    @IsNotEmpty(
        {
            message: '缺少id',
        },
    )
    primary_cod: {
        fld_eng: string,
        code: string
    };
}
export class UpdateCntrSizeDto extends PartialType(CntrSizeDto) implements UpdateDto{
    @IsString(
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'string',
    })
    primary_cod: string;
}

export class UpdateCntrTypeDto extends PartialType(CntrTypeDto) {
    @IsString(
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'string',
    })
    primary_cod: string;
}

export class UpdateCyCfsDto extends PartialType(CyCfsDto) implements UpdateDto {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;
}
export class UpdateCfsStroageDto extends PartialType(CfsStorageDto) implements UpdateDto {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;
}
export class QueryCfsStorageDto {
    @IsNumber({}, { message: '缺少站点ID'})
    cfs_id: number;
}
export class UpdateCyCfsAreaDto extends PartialType(CyCfsAreaDto) implements UpdateDto {    

    @IsNotEmpty({
        message: '缺少id',
    })
    primary_cod: {
        cfs_cod: string,
        cy_area: string;
    };
}

export class UpdateClientDto extends PartialType(ClientDto) implements UpdateDto {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;
}

export class UpdatePlaceDto extends PartialType(PlaceDto) implements UpdateDto {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;
}

export class UpdateUserQueryCfgDto extends PickType(UserQueryCfgDto, ['cfg_json']) implements UpdateDto {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    id: number;
}

export class UpdateFeeReportDefineDto extends PartialType(FeeReportDefineDto) implements UpdateDto {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    id: number;
}
